package com.sinux.sshUser.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinux.sshUser.dao.ResourcesDaoI;
import com.sinux.sshUser.entity.Resources;
import com.sinux.sshUser.entity.Role;
import com.sinux.sshUser.service.ResourcesServiceI;

/**
 * @author WangGan
 * @version 2017年5月25日 下午4:46:43 
 * 
 */
@Service
public class ResourcesServiceImpl implements ResourcesServiceI {
	
	@Autowired
	private ResourcesDaoI resDao;
	
	@Override
	public List<Resources> findAllResList() {
		List<Resources> ress=resDao.find("from Resources t");
		return ress;
	}

	@Override
	public List<Resources> findResList(String value) {
		String hql="from Resources u where (u.reid like '%"+value+"%' or u.rename like '%"+value+"%')";
		List<Resources> ress=resDao.find(hql);
		return ress;
	}
	@Override
	public List<Resources> findResList(String value,int page, int rows) {
		String hql="from Resources u where (u.reid like '%"+value+"%' or u.rename like '%"+value+"%')";
		List<Resources> ress=resDao.find(hql,page, rows);
		return ress;
	}

	@Override
	public List<Resources> findResPageing(int page, int rows) {
		String hql="from Resources u ";
		List<Resources> ress=resDao.find(hql, page, rows);
		return ress;
	}
	
	
}
